package day3;

/**
 * @author oldliu
 * @since 1.0
 */
public class CharTest {
    public static void main(String[] args) {
        int x=0b100;
        System.out.println(x);
        // c>=0x9fa5
//        String str="我喜欢java";
//        char[] chars = str.toCharArray();
//        for(char c:chars){
//            System.out.println((int)c);
//        }
        String name = "abc刘.rar";
        String c = name.substring(0, name.lastIndexOf('.'));
        char[] aa = c.toCharArray();
        int z = 0;
        for (int as : aa) {
            if (as > 255) {
                z = 0;
            } else {
                z++;
                //break;
            }
        }
        if (z == 0) {
            System.out.println("格式正确");
        } else {
            System.out.println("格式错误");

        }
    }
}
